stack = []

def inStack(name):
    stack.append(name)

def outStack(name):
    for i in range(len(stack)-1,-1,-1):
        if name == stack[i]:
            stack.pop()
            break
        stack.pop()

if __name__ == '__main__':
    n = int(input())
    for i in range(n):
        op = input().split()
        if op[0] == 'in':
            inStack(op[1])
        if op[0] == 'out':
            outStack(op[1])

    if stack:
        print(stack[-1])
    else:
        print("Empty")